package cn.luzhangduo.studentsystemproject.service;

import cn.luzhangduo.studentsystemproject.mapper.AgentMapper;
import cn.luzhangduo.studentsystemproject.model.Agent;
import cn.luzhangduo.studentsystemproject.model.ChartItem;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AgentServiceImpl implements AgentService {
    @Autowired
    private AgentMapper agentMapper;

    @Override
    public boolean addAgent(Agent agent){
        return agentMapper.add(agent);
    }
    @Override
    public boolean deleteAgentById(int id){
        return agentMapper.delete(id);
    }
    @Override
    public boolean updateAgent(Agent agent){
        return agentMapper.update(agent);
    }
    @Override
    public Agent getAgentById(int id){
        return agentMapper.get(id);
    }
    @Override
    public List<Agent> getAgents(){
        return agentMapper.getAll();
    }

    @Override
    public List<ChartItem> getAgentDatas() {
        return agentMapper.getAgentDatas();
    }
}
